package com.example.g2daylx2

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.alibaba.android.arouter.launcher.ARouter
import com.blankj.utilcode.util.ToastUtils
import com.example.g2daylx2.bvm.LongViewModel
import com.example.g2daylx2.databinding.ActivitySearBinding
import com.example.lib_base.net.mvvm.BaseActivity
import dagger.hilt.android.AndroidEntryPoint
import dagger.hilt.android.HiltAndroidApp

@AndroidEntryPoint
class SearActivity : BaseActivity<ActivitySearBinding,LongViewModel>() {
    override fun initView() {
        binding.sear.setOnClickListener {
            vm.sear(binding.username.text.toString(),binding.password.text.toString())
        }
    }

    override fun initData() {
        vm.searSuccess.observe(this){
            ToastUtils.showLong("注册成功")
            ARouter.getInstance().build("/app/LoginActivity").navigation()
        }
    }

}